package com.plian.system.service.wf;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.bean.wf.TaskWithForm;
import com.plian.system.model.ListResult;
import org.flowable.ui.modeler.domain.ApprovalPoints;

import java.util.List;
import java.util.Map;

public interface WorkflowService {
    void startProcessInstanceByKeyAndTenantId(String formId, int formType, Map<String, Object> variables,String startUserId);

    void submit(String formId, int formType, Map<String, Object> variables) throws Exception;

    List<TaskWithForm> getTodoTaskListByUserId(String userId,String organizationId) throws Exception;

    void rollBack(String formId);

    void clearOldUnWorkFlow(int formType, String formId);

    void turnBack(String formId, String comment, List<ApprovalPoints> approvalPointsList) throws Exception;

    String returnFirst(String formId, String comment, List<ApprovalPoints> approvalPointsList);

    Map<String, Object> getTaskInfoByFormId(String businessKey);

    String completeTask(String formId, String comment, Map<String, Object> variables);

    void beforeAddSign(String formId, String userId,String signedUserId) ;

    boolean isFinish(String formId);

    ListResult<PageData> getCompletedTasksByCurrentUserInPage(PageData pageData);

    /**
     * 获取所有已办单据类型
     * @param pageData
     * @return
     */
    List<Integer> getFormTypes(PageData pageData);

    void rollBackBeforeSign(String formId);

    void goBackToStash(String formId,int formType);

    void deleteUnknowReceipts();

    /**
     * 待办 手动分页(暂时先这样处理)
     * @param allList
     * @param pd
     * @return
     */
    List<TaskWithForm> listPage(List<TaskWithForm> allList, PageData pd);

    /**
     * 根据所有流程 待办列表相关数据
     */
    void updateVariablesAllInfo();
}

